public class Doctor extends DoctorFather{
    public Doctor(String name, int age, String job, char gender, double sal) {
        super(name, age, job, gender, sal);
    }

    @Override
    public boolean equals(Object object) {
        if (object instanceof Doctor doctor) {
            return this.getAge() == doctor.getAge() && this.getName().equals(doctor.getName()) && this.getJob().equals(doctor.getJob()) && this.getGender() == doctor.getGender() && this.getSal() == doctor.getSal();
        }
        return false;
    }
}
